function hotkey(action, button) {
	this.action = action,
	this.button = button
}

var hotkeys = {
	
	onLoad : function() {
		active = [0, 0, 0, 0];
		keycodes = [39, 38, 37, 40];
		actions = ["hægri", "upp", "vinstri", "niður"];
	},
	
	setKeyAction : function() {
		// Action fellilisti? og stadur til að skrifa inn hvada takka thu vilt
	},
	
	detectConflict : function() {
		// kemur i veg fyrir ad thu tvibindir einn takka
	},
	
	keydown : function(keycode) {
		active[keycodes.indexOf(keycode)] = 1;
	},
	
	keyup : function(keycode) {
		active[keycodes.indexOf(keycode)] = 0;
	},
	
	sendPulse : function() {
		moveX = 0;
		moveY = 0;
		for(var i=0; i < active.length; i++) {
			if(active[i] == 1) {
				switch(actions[i]) {
					case "hægri":
						moveX += 1;
						break;
					case "upp":
						moveY -= 1;
						break;
					case "niður":
						moveY += 1;
						break;
					case "vinstri":
						moveX -= 1;
						break;
				}
			}
		}
		if(moveX != 0 || moveY != 0) {
			movement.tryToMove(moveX, moveY);
		}
	}
};

$(document).keydown(function(event) {
	hotkeys.keydown(event.which);
});

$(document).keyup(function(event) {
	hotkeys.keyup(event.which);
});